﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace ValidateEmail
{
    class ValidateEmail
    {
        static void Main(string[] args)
        {
            string text = "zuzi@mail.bg;; ciki@duduk.net, " + "bob@mail.bg\n\nfn12345@fmi.uni-sofia.bg\n" +
                "    mente@eu.int | , , ;;; gero@dir.bg";

            string pattern = @"\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,4}";

            Match emailMatcher = Regex.Match(text, pattern);

            while(emailMatcher.Success)
            {
                Console.WriteLine("{0} is valid email", emailMatcher);
                emailMatcher = emailMatcher.NextMatch();
            }
        }
    }
}
